{% extends "blog.html" %}

{% block description %}
  <meta name="description" content="{% for tag in blog.tags %}{{ tag }}, {% endfor %}{{blog.content|striptags|truncatewords:20}}">
{% endblock %}

{% block head %}
{% endblock %}

{% block content %}
  {% include "div_blog.html" %}
  
  <div>
  {% for comment in comments %}
    <div class="post">
    
	    <div class="CommentTitle">
	    {{ comment.author }} {{ comment.date.date }} {{ comment.date|time:"H:i" }}
	    </div>
	    
	    <div class="CommentText">{{ comment.content|removetags:"script" }}</div>
	
		  <div class="BlogOperation">
		  
		  {% if comment.auth.delete %}
		  <a class="BlogOperation" 
		    onclick="$.post('{{config.url_blog}}/comment/delete/{{ comment.key.id }}/', function(data){document.location.reload();});" 
		    href="#">{{ lang.delete }}</a>
		  {% endif %}
		
		  </div>

    </div>
  {% endfor %}
  </div>

  {% include "div_pagination.html" %}
    
  <div class="CommentAdd">
  {% if auth_comment.add %}
  <form action="{{config.url_blog}}/comment/{{ blog.key.id }}/" method="post">
    <div>
    <label for="commentdata">{{ lang.comment_add }}:</label><br>
    <textarea id="wysiwyg" class="bloginput" name="commentdata" rows="12"></textarea>
    </div>
    <div>
    <input type="submit" class="button" value="{{ lang.add }}">
    </div>
  </form>

  {% endif %}
  </div>
  
{% endblock %}